<%@ page import="java.util.ArrayList" %>
<%@ page import="com.jr.pojo.ProjectInfo" %><%--
  Created by IntelliJ IDEA.
  User: de'l'l
  Date: 2025/8/26
  Time: 15:40
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>

<%-- jsp往服务器跳 写绝对路径：从/项目名/开始   --%>
<form action="/aaa/projectInfo/query" method="get">
    申报状态
    <select name="status">
        <option value="-1">全部</option>
        <option value="0">已申报</option>
        <option value="1">审核中</option>
        <option value="2">已审核</option>
    </select>
    <input type="submit" value="查询">
</form>

<%
    ArrayList<ProjectInfo> list = (ArrayList<ProjectInfo>) session.getAttribute("list");
%>

<table>
    <%--标题--%>
    <caption>申报项目列表</caption>
    <tr>
        <%--表头--%>
        <th>项目编号</th>
        <th>项目名称</th>
        <th>开始时间</th>
        <th>结束时间</th>
        <th>申报状态</th>
        <th>操作</th>
    </tr>
    <% for (ProjectInfo pro : list) { %>
    <tr>
        <td><%=pro.getPid()%></td>
        <td><%=pro.getPname()%></td>
        <td><%=pro.getStartdate()%></td>
        <td><%=pro.getEnddate()%></td>
        <td><%=getProStatus(pro.getStatus())%></td>
        <td>
            <% if (pro.getStatus() == 0) { %>
            <a href="/aaa/projectInfo/queryByPid?pid=<%=pro.getPid()%>">审核</a>
            <% }%>
        </td>
    </tr>
    <% } %>

    <tr>
        <%--合并6个列--%>
        <td colspan="6">
            <%
                Object mess = session.getAttribute("mess");
                if (mess != null) {
            %>
            <b style="color: red"><%=mess%> </b>
            <%
                }
            %>
        </td>
    </tr>
</table>

<%!
    public String getProStatus(int status) {
        if (status == 0) {
            return "已申报";
        } else if (status == 1) {
            return "审核中";
        } else{
            return "已审核";
        }
    }
%>


</body>
</html>
